﻿using System;
using System.Collections.Generic;
using System.Text;

namespace CaveDigital.SharedLib
{
    public static class Number
    {

		#region Static Methods (1) 
        public static string NumberToEnglishDay(int number)
        {
            string strNumber = number.ToString();
            if (number <= 0 || number > 31)
                return null;
            if (strNumber.Length == 2 && strNumber.Substring(0, 1) == "1")
                return string.Concat(strNumber, EN_EN_REMAINING);
            switch (int.Parse(strNumber.Substring(strNumber.Length > 1 ? 1 : 0, 1)))
            {
                case 1: return string.Concat(strNumber, EN_EN_FIRST);
                case 2: return string.Concat(strNumber, EN_EN_SECOND);
                case 3: return string.Concat(strNumber, EN_EN_THIRD);
                default: return string.Concat(strNumber, EN_EN_REMAINING);
            }
        }

		#endregion Static Methods 


        #region CONSTANTS
        private static string EN_EN_FIRST = "st";
        private static string EN_EN_SECOND = "nd";
        private static string EN_EN_THIRD = "rd";
        private static string EN_EN_REMAINING = "th";
        #endregion
    }
}
